import request from '@/utils/request';

export async function getTrack(params) {
  return request(`/fss/Exchange/Track`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}
export async function getMailOptionPrice(params) {
  return request(`/fss/CxMail/mailOptionPrice`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}
export async function getHistory(params) {
  return request(`/fss/Exchange/History`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export async function delExchange(params) {
  return request(`/fss/Exchange/DelExchange?id=${params}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export async function addExchange(params) {
  return request(`/fss/Exchange/AddExchange`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}

export async function updateExchange(params) {
  return request(`/fss/Exchange/updateExchange`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}

//外汇现货
export async function getExchangePosition(params) {
  return request(`/fss/Exchange/ExchangePosition`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export async function delExchangePosition(params) {
  return request(`/fss/Exchange/DelExchangePosition?id=${params}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}

export async function addExchangePosition(params) {
  return request(`/fss/Exchange/AddExchangePosition`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}

export async function updateExchangePosition(params) {
  return request(`/fss/Exchange/UpdateExchangePosition`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(params),
  });
}
